package iohomework;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class SecCopyDemo {
    public static void main(String[] args) throws IOException {

        FileInputStream fis=new FileInputStream("cxk.jpg");
        FileOutputStream fos=new FileOutputStream("cxk_cp.jpg");
        long start=System.currentTimeMillis();
        int a;
        while((a=fis.read())!=-1){
            fos.write(a);
        }
        long end=System.currentTimeMillis();
        System.out.println("复制成功,耗时"+(end-start)+"ms");
        fis.close();
        fos.close();

    }
}
